package com.zm.Study10_BufferedWriter;

import java.io.*;

public class BufferedWriterDemo01 {

    public static void main(String[] args) throws IOException {
     //   OutputStreamWriter osw=new OutputStreamWriter(new FileOutputStream("D:\\project\\IDEAPROJECT\\JavaIO\\src\\main\\resources\\static\\BufferedReader_Writer\\writer.txt"));
     //   BufferedWriter bw=new BufferedWriter(osw);

        //但既然我们已经学过了FileWriter了所以：
        BufferedWriter bw=new BufferedWriter(new  FileWriter("D:\\project\\IDEAPROJECT\\JavaIO\\src\\main\\resources\\static\\BufferedReader_Writer\\writer.txt"));

        bw.write(97);

        String str="qweqdawda";
        bw.write(str);
        bw.newLine();   //分隔符由系统决定，根据当前系统自适应
        bw.write(str,0,3);
        bw.newLine();

        char[] chars={'a','b','c'};
        bw.write(chars);
        bw.newLine();
        bw.write(chars,0,3);


        bw.close();

    }



}
